//
//  UIView+EmptyContent.h
//  iOSBaseFramework
//
//  Created by user on 2020/6/17.
//  Copyright © 2020 com.taylor. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN


typedef NS_ENUM(NSInteger, TRViewDataType)
{
    TRViewDataTypeWifi = 0,
    TRViewDataTypeMyOrder,
    TRViewDataTypeLoadFail,
};

typedef void(^ReloadDataBlock)();

@interface TRCustomerWarnView : UIView

@property (nonatomic, strong) UIImageView *imageView;
@property (nonatomic, strong) UILabel  *tiplabel;
@property (nonatomic, strong) UIButton *loadBtn;
@property (nonatomic, copy) ReloadDataBlock reloadBlock;

+ (TRCustomerWarnView *)initWithFrame:(CGRect)frame andType:(TRViewDataType)type;
@end


// 空视图
@interface UIView (TREmptyContent)

@property (nonatomic,strong) TRCustomerWarnView *warningView;

/**
 *  空页面显示提醒图与文字并添加重新刷新
 *
 *  @param emptyType 页面的展示的数据类别（例如：我的订单或者web页）
 *  @param haveData  是否有数据
 *  @param block     重新加载页面（不需要时赋空）
 */
- (void)emptyDataCheckWithType:(TRViewDataType)emptyType
                   andHaveData:(BOOL)haveData
             andReloadCallback:(ReloadDataBlock)block;

@end

NS_ASSUME_NONNULL_END
